#!/usr/bin/env bash
set -euf -o pipefail

IMAGE_NAME="terrat-ee"
GHCR_IMAGE="ghcr.io/${GITHUB_REPOSITORY_OWNER}/${IMAGE_NAME}:${VERSION_TAG}"
FLY_APP_PREFIX="${FLY_APP_PREFIX:-terrateam-app}"

flyctl deploy --strategy bluegreen --access-token "${FLY_API_TOKEN}" --image "${GHCR_IMAGE}" -a "${FLY_APP_PREFIX}-${TERRATEAM_ENVIRONMENT}"
